<template>
  <div style="padding-left: 2%">
    <el-row type="flex" :gutter="20" style="padding-left: 20px">
      <h2 class="subtitle" style="margin-top: 20px; margin-left: 5px">风电场风机发电量月报表</h2>
    </el-row>
    <div style="height: auto;margin: 0 10px">
      <iframe id="reportFrame" scrolling="no" frameborder="0" :src="src"></iframe>
    </div>
  </div>
</template>

<script>
import { reportURL } from '@/config/baseConfig'

export default {
  name: 'index',
  data () {
    return {
      src: reportURL + 'productionMonthReport%252FmonthWindFarmDevicesProduction.cpt' + '&op=write'
    }
  },
  methods: {
  },
  mounted () {
    const oIframe = document.getElementById('reportFrame')
    const deviceWidth = Number(document.documentElement.clientWidth)
    const deviceHeight = Number(document.documentElement.clientHeight)
    oIframe.style.width = (deviceWidth - 200) / deviceWidth * 100 + 'vw' // 数字是页面布局宽度差值
    oIframe.style.height = (deviceHeight - 200) / deviceHeight * 100 + 'vh' // 数字是页面布局高度差
    // const tableContent = document.getElementById('content-container')
    // tableContent.setAttribute('style', 'padding: 0 5% !important')
  }
}
</script>

<style scoped>
  /*::v-deep .content-container {*/
  /*  padding: 0 5% !important;*/
  /*}*/
</style>
